package com.huangfu.easysardine.monitor.rest;

import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created with IntelliJ IDEA.
 * User: huangfu.daohui
 * Date: 2017-8-14
 * Time: 13:35
 * Description: * 要先请求监控服务
 * http://localhost:8764/login
 */
@Controller
public class SecurityController {

    //添加断路器
    @RequestMapping(value = "/login")
    @HystrixCommand(fallbackMethod = "loginError")
    public String login() {
        return "login";
    }

    public String loginError() {
        return "hi,sorry,login error!";
    }
}
